package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the formation database table.
 * 
 */
@Entity
@NamedQuery(name="Formation.findAll", query="SELECT f FROM Formation f")
public class Formation implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idFormation;

	private String lieu;

	private int nbrSession;

	private String nom;

	//bi-directional many-to-one association to Niveau
	@ManyToOne
	@JoinColumn(name="idNiveau")
	private Niveau niveau;

	//bi-directional many-to-one association to Formationannee
	@OneToMany(mappedBy="formation")
	private List<Formationannee> formationannees;

	//bi-directional many-to-one association to Ueformation
	@OneToMany(mappedBy="formation")
	private List<Ueformation> ueformations;

	public Formation() {
	}

	public int getIdFormation() {
		return this.idFormation;
	}

	public void setIdFormation(int idFormation) {
		this.idFormation = idFormation;
	}

	public String getLieu() {
		return this.lieu;
	}

	public void setLieu(String lieu) {
		this.lieu = lieu;
	}

	public int getNbrSession() {
		return this.nbrSession;
	}

	public void setNbrSession(int nbrSession) {
		this.nbrSession = nbrSession;
	}

	public String getNom() {
		return this.nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public Niveau getNiveau() {
		return this.niveau;
	}

	public void setNiveau(Niveau niveau) {
		this.niveau = niveau;
	}

	public List<Formationannee> getFormationannees() {
		return this.formationannees;
	}

	public void setFormationannees(List<Formationannee> formationannees) {
		this.formationannees = formationannees;
	}

	public Formationannee addFormationannee(Formationannee formationannee) {
		getFormationannees().add(formationannee);
		formationannee.setFormation(this);

		return formationannee;
	}

	public Formationannee removeFormationannee(Formationannee formationannee) {
		getFormationannees().remove(formationannee);
		formationannee.setFormation(null);

		return formationannee;
	}

	public List<Ueformation> getUeformations() {
		return this.ueformations;
	}

	public void setUeformations(List<Ueformation> ueformations) {
		this.ueformations = ueformations;
	}

	public Ueformation addUeformation(Ueformation ueformation) {
		getUeformations().add(ueformation);
		ueformation.setFormation(this);

		return ueformation;
	}

	public Ueformation removeUeformation(Ueformation ueformation) {
		getUeformations().remove(ueformation);
		ueformation.setFormation(null);

		return ueformation;
	}

}